import request from '@/plugin/axios'

export function upload (file, config = {}) {
  const data = new FormData()
  data.append('file', file)
  return request({
    url: 'v1/uploads',
    method: 'post',
    header: {
      'Content-Type': 'multipart/form-data'
    },
    data,
    ...config
  })
}
